Reseller System Rules

Scope: All resellers on *.claritysystems.work
Last updated: April 2026
Read this before any reseller session.


What a Reseller Is

A reseller promotes and sells Lovinia's courses under their own identity. They use Lovinia's content, design system, and automation pipeline. They collect their own leads. They do not access Lovinia's data.


Infrastructure Model

Repo

Monorepo: claritysystems-lobby (GitHub: iamanoob2024/claritysystems-lobby)
All reseller sites live under resellers/{reseller-id}/ in the same repo.
Cloudflare Pages deploys each reseller from its subfolder as a separate Pages project.

Per-Reseller Cloudflare Resources

Each reseller gets their own isolated stack:

Resource Naming convention Notes
Pages project {reseller-id}-{course-slug} e.g. newrise-sales-training One project per course per reseller
Worker {reseller-id}-enquiry e.g. newrise-enquiry One worker per reseller (handles all courses)
D1 database {reseller-id}-db e.g. newrise-db Reseller sees only their leads
KV namespace {reseller-id}-kv e.g. newrise-kv Stores TP config, invoice counter, templates
R2 bucket {reseller-id}-assets e.g. newrise-assets Logo, PDF templates, course assets

All resources live in Lovinia's Cloudflare account. Reseller never gets account access.

Domain

{reseller-id}.claritysystems.work/{course-slug}
Examples:

No lobby at root. Each course is a separate path. If a reseller later needs a lobby, that is a separate decision.


Content Model

What Lovinia owns and controls (reseller cannot modify)

What lives per-reseller

Shared content rendering

Articles, FAQ (where applicable), and course materials are authored once.
Eleventy renders them with the reseller's nav and enquiry CTAs injected via layout parameter.
Reseller clients never leave the reseller's subdomain when reading shared content.


Page Model Per Course

Every course a reseller promotes follows this page set:

Page Path Notes
Landing /{course-slug}/ Main sales page
Pricing /{course-slug}/pricing/ No Stripe links unless agreed
Enquiry — Public /{course-slug}/enquiry/ 1–6 pax, HRDC grant path
Enquiry — Corporate /{course-slug}/corporate-enquiry/ 7–40 pax, fixed in-house rate
Confirmation /{course-slug}/confirmation/ Post-submission thank you
About /about/ Shared across courses on same subdomain, reseller-scoped nav
Articles /articles/ Lovinia's content, reseller nav + CTAs
FAQ /{course-slug}/faq/ Course + path specific. Cannot reuse Lovinia's FAQ — her FAQ discourages HRDC

Register page (/register/) is excluded from all reseller sites unless reseller has Stripe and direct payment agreed separately.


Enquiry Pipeline (Standard — HRDC Grant Path)

This is the default pipeline for all resellers unless explicitly varied:

Client fills enquiry form
  → Worker validates (grant path only)
  → Proforma invoice generated (reseller identity, reseller bank)
  → Tentative course schedule generated
  → Both PDFs emailed to client (from [email protected] via Resend)
  → Alert email sent to reseller's alert_email
  → Telegram alert sent to Lovinia
  → Lead written to reseller's D1

Reseller follows up. Reseller sends true invoice and confirmed schedule when HRDC grant approved.


Pax Tiers

Pax range Product type Form Pricing
1–6 Public training, HRDC grant claim Public enquiry form Per-person × pax, live calculated
7–40 In-house / corporate Corporate enquiry form Fixed RM22,000 (or reseller's agreed rate)

Public form caps at 6. If user enters 7+, form redirects / prompts to corporate enquiry. Corporate form minimum is 7.


Invoice Rules

Field Rule
Prefix Per-reseller. Set in reseller.json and KV.
Counter Per-reseller KV key: invoice:{reseller-id}:last_number
SST Per-reseller. Rate and number in KV. Suppressed if sst_number is null.
Issued by Always reseller identity — never Lovinia's unless client is Lovinia's direct.
Payment details Always reseller's bank — never Lovinia's.
Sent from Always [email protected] (Lovinia's verified Resend domain).

Data Config Files

_data/resellers/{reseller-id}.json

Eleventy data file. Used by templates at build time for nav, CTAs, identity.

KV key tp:{reseller-id}

Runtime config for the worker. Same fields as the JSON file. Updated via wrangler kv key put — no redeploy needed for field changes (SST number, bank details, etc.).

Global config

sales-training/config.js — prices, event dates, earlybird deadline, announcements.
Reseller pages load this first, then apply overrides from their own config if set.


Adding a New Reseller — Checklist

  1. Create _data/resellers/{reseller-id}.json
  2. Create resellers/{reseller-id}/{course-slug}/ page folder
  3. Create Cloudflare D1: wrangler d1 create {reseller-id}-db
  4. Create Cloudflare KV: wrangler kv namespace create {reseller-id}-kv
  5. Create Cloudflare R2: via dashboard or wrangler r2 bucket create {reseller-id}-assets
  6. Fork worker into workers/{reseller-id}-enquiry/, update wrangler.toml bindings
  7. Add tp:{reseller-id} KV entry
  8. Create Cloudflare Pages project from monorepo subfolder resellers/{reseller-id}/
  9. Add DNS CNAME: {reseller-id}.claritysystems.work → Pages project
  10. Add custom domain in Pages dashboard
  11. Smoke test full pipeline

What Resellers Do NOT Get